#ifndef BUTTON_H
#define BUTTON_H

#include "GameManager.h"
#include "ImageManager.h"
#include <string>

class Button
{
public:
    Button(float x = 0.f, float y = 0.f, float w = 32.f, float h = 32.f);

    void resize(float w, float h);
    void setPosition(float x, float y);

    bool hovering();
    bool clicked();

    void render(GameManager* mgr);
    void handleEvents(GameManager* mgr);

    void setImage(std::string name);
    void setClickedImage(std::string name);

protected:
    sf::Sprite m_image;
    sf::Sprite m_clickedImage;
    sf::Event m_event;
    sf::Input m_input;
    float m_x;
    float m_y;
    float m_width;
    float m_height;

    float m_mouseX;
    float m_mouseY;

    bool m_hovering;
    bool m_clicked;
};

#endif
